<?php
if($conversations!=NULL){
foreach ($conversations as $row) {
    echo "<div class='conversation_div' onclick='javascript:getConversation({$row->from},{$row->to})' id='div_".$row->from.$row->to."'>
                        <input type='hidden' name='conversation[{$row->from}]' id='conversation_from' value='{$row->from}'/>
                        <input type='hidden' name='conversation[{$row->to}]' id='conversation_to' value='{$row->to}'/>";
                      echo "<input type='hidden' id='usernameFrom_{$row->from}'  value='{$row->username_from}'/>";
                      echo "<input type='hidden' id='usernameTo_{$row->to}'  value='{$row->username_to}'/>";
   
   if ($row->image_name_from != NULL)
        $image = "<img src='" . base_url() . "profile/image/thumb/{$row->from}/{$row->image_name_from}' alt='{$row->username_from}'>";
    else
        $image = "<img src='" . base_url() . "img/no_photo.gif' alt=''>";
    echo $image;
    if ($row->image_name_to != NULL)
        $image = "<img  src='" . base_url() . "profile/image/thumb/{$row->from}/{$row->image_name_to}' alt='{$row->username_to}'>";
    else
        $image = "<img  src='" . base_url() . "img/no_photo.gif' alt=''>";
    echo $image;
    echo "<p style='float: left;'> 
                        {$row->username_from}
                       </p>";
     echo "<p style='float: left;'> 
                        {$row->username_to}
                       </p>";
    echo "<p style='float: left;'> <b>[
                        {$row->num_messages}
                      ]</b> </p>";
    echo        " </div>";
}
}
?>
